/**
 * Created by Charlotte on 2017/9/5.
 */
var $link = $(".left-nav").find('a');
function getRootPath() {
    //获得根目录
    var strFullPath = window.document.location.href;
    var strPath = window.document.location.pathname;
    var pos = strFullPath.indexOf(strPath);
    var prePath = strFullPath.substring(0, pos);
    var postPath = strPath.substring(0, strPath.substr(1).indexOf('/') + 1);
    return (prePath + postPath);
}
function LoadHtml(name) {
    var path=getRootPath();
    var url = path+"/project"+"/view/"+name+".html";
    $('.content').load(url);
}
$link.on('click',function () {
    var result= $(this).attr("data");

    if(result == "livemanage")
    {
        LoadHtml("admin-live-manage");
    }
    // else if(result=="follow")
    // {
    //     LoadHtml("personfollow")
    // }
    // else if(result == "password")
    // {
    //     LoadHtml("resetpassword")
    // }
    // else if(result=="applyLive")
    // {
    //     LoadHtml("applyLive");
    // }
    // else  if (result =="myroom")
    // {
    //     LoadHtml("myroom");
    // }else if(result=="myvideo")
    // {
    //     LoadHtml("myvideo");
    // }
    else
    {
        LoadHtml("error");
    }
})
